const data = [1,1,2,1,1,1,1,3,3,4,5,5,6,6]


function findData(data) {
    let count= 0,cur = data[0]

    for(let i =0; i< data.length; i++) {
        if(count===0){
            cur = data[i]
        }
        if(cur === data[i]){
            count++
        }else{
            count--
        }
        console.log(cur, count);
    }
    return cur;
}


console.log(findData(data));

